package com.afsadmedia.pregnancy;

import com.actionbarsherlock.app.SherlockActivity;
import com.darvds.ribbonmenu.R;
import com.darvds.ribbonmenu.RibbonMenuView;
import com.darvds.ribbonmenu.iRibbonMenuCallback;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;
import android.widget.Toast;
import android.widget.AdapterView.OnItemClickListener;

public class HomeActivity extends SherlockActivity implements
		iRibbonMenuCallback {
	private ListView list;
	private ArrayAdapter<String> adapter;
	private RibbonMenuView rbmView;
	private Button test;
	private ListView rbmListView;
	private ListView rbmListView2;
	private ArrayAdapter<String> adapt;
	private ArrayAdapter<String> adapter2;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_home);
		rbmView = (RibbonMenuView) findViewById(R.id.ribbonMenuView1);
		rbmView.setMenuClickCallback(this);
		rbmView.setMenuItems(R.menu.ribbon_menu);

		Button calendar = (Button) findViewById(R.id.button_calendar);

		calendar.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub

				Intent i = new Intent(HomeActivity.this, CalendarActivity.class);
				startActivity(i);

			}
		});

		Button alarm = (Button) findViewById(R.id.button_alarm);

		alarm.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub

				// loginToFacebook();
				Intent i = new Intent(HomeActivity.this, Alarm.class);
				startActivity(i);

			}
		});

		Button register = (Button) findViewById(R.id.button_redister);

		register.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub

				// loginToFacebook();
				Intent i = new Intent(HomeActivity.this, Registeration.class);
				startActivity(i);

			}
		});
	}

	public boolean onCreateOptionsMenu(com.actionbarsherlock.view.Menu menu) {

		getSupportActionBar().setBackgroundDrawable(
				getResources().getDrawable(R.drawable.actionbar_background));
		getSupportActionBar().setTitle("Pregnant Kit");

		getSupportActionBar().setHomeButtonEnabled(true);
		return super.onCreateOptionsMenu(menu);

	}

	public boolean onOptionsItemSelected(
			com.actionbarsherlock.view.MenuItem item) {
		switch (item.getItemId()) {

		case android.R.id.home:
			rbmView.toggleMenu();
			break;

		default:
			return super.onOptionsItemSelected(item);
		}
		return true;
	}

	@Override
	public void RibbonMenuItemClick(int itemId) {
		// TODO Auto-generated method stub
		switch (itemId) {
		case R.id.ribbon_menu_home:
			
			break;
			
		case R.id.ribbon_menu_calendar:
			Intent i = new Intent(HomeActivity.this, CalendarActivity.class);
			startActivity(i);
			break;
			
		case R.id.ribbon_menu_tips:
			break;
		case R.id.ribbon_menu_profile:
			break;
		case R.id.ribbon_menu_photofun:
			break;
		case R.id.ribbon_menu_articles:
			break;
		case R.id.ribbon_menu_store:
			break;
		case R.id.ribbon_menu_logout:
			break;
		}
		
	}
}
